home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 1998 November / IRIX 6.5.2 Base Documentation November 1998.img / usr / share / catman / u_man / cat1 / newform.z / newform
Text File  |  1998-10-20  |  9KB  |  199 lines

  1.  
  2.  
  3.  
  4. NNNNEEEEWWWWFFFFOOOORRRRMMMM((((1111))))                                                          NNNNEEEEWWWWFFFFOOOORRRRMMMM((((1111))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      newform - change the format of a text file
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      nnnneeeewwwwffffoooorrrrmmmm [ options ] [ files ]
  13.  
  14. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  15.      _n_e_w_f_o_r_m reads lines from the named _f_i_l_e_s, or the standard input if no
  16.      input file is named, and reproduces the lines on the standard output.
  17.      Lines are reformatted in accordance with command line options in effect.
  18.  
  19.      Except for ----ssss, command line options may appear in any order, may be
  20.      repeated, and may be intermingled with the optional _f_i_l_e_s.  Command line
  21.      options are processed in the order specified.  This means that option
  22.      sequences like ``----eeee15 ----llll60'' will yield results different from ``----llll60
  23.      ----eeee15''.  Options are applied to all _f_i_l_e_s on the command line.
  24.  
  25.      ----ssss        Shears off leading characters on each line up to the first tab
  26.                and places up to 8 of the sheared characters at the end of the
  27.                line.  If more than 8 characters (not counting the first tab)
  28.                are sheared, the eighth character is replaced by a **** and any
  29.                characters to the right of it are discarded.  The first tab is
  30.                always discarded.
  31.  
  32.                An error message and program exit will occur if this option is
  33.                used on a file without a tab on each line.  The characters
  34.                sheared off are saved internally until all other options
  35.                specified are applied to that line.  The characters are then
  36.                added at the end of the processed line.
  37.  
  38.                For example, to convert a file with leading digits, one or more
  39.                tabs, and text on each line, to a file beginning with the text,
  40.                all tabs after the first expanded to spaces, padded with spaces
  41.                out to column 72 (or truncated to column 72), and the leading
  42.                digits placed starting at column 73, the command would be:
  43.                newform -s -i -l -a -e file-name
  44.  
  45.      ----iiii_t_a_b_s_p_e_c Input tab specification:  expands tabs to spaces, according to
  46.                the tab specifications given.  _T_a_b_s_p_e_c recognizes all tab
  47.                specification forms described in _t_a_b_s(1).  In addition, _t_a_b_s_p_e_c
  48.                may be --------, in which _n_e_w_f_o_r_m assumes that the tab specification
  49.                is to be found in the first line read from the standard input
  50.                (see _f_s_p_e_c(4)).  If no _t_a_b_s_p_e_c is given, _t_a_b_s_p_e_c defaults to
  51.                ----8888.  A _t_a_b_s_p_e_c of ----0000 expects no tabs; if any are found, they
  52.                are treated as ----1111.
  53.  
  54.      ----oooo_t_a_b_s_p_e_c Output tab specification:  replaces spaces by tabs, according
  55.                to the tab specifications given.  The tab specifications are
  56.                the same as for ----iiii_t_a_b_s_p_e_c.  If no _t_a_b_s_p_e_c is given, _t_a_b_s_p_e_c
  57.                defaults to ----8888.  A _t_a_b_s_p_e_c of ----0000 means that no spaces will be
  58.                converted to tabs on output.
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. NNNNEEEEWWWWFFFFOOOORRRRMMMM((((1111))))                                                          NNNNEEEEWWWWFFFFOOOORRRRMMMM((((1111))))
  71.  
  72.  
  73.  
  74.      ----bbbb_n       Truncate _n characters from the beginning of the line when the
  75.                line length is greater than the effective line length (see
  76.                ----llll_n).  Default is to truncate the number of characters
  77.                necessary to obtain the effective line length.  The default
  78.                value is used when ----bbbb with no _n is used.  This option can be
  79.                used to delete the sequence numbers from a COBOL program as
  80.                follows:
  81.                newform -l1 -b7 file-name
  82.  
  83.      ----eeee_n       Same as ----bbbb_n except that characters are truncated from the end
  84.                of the line.
  85.  
  86.      ----pppp_n       Prefix _n characters (see ----cccc_k) to the beginning of a line when
  87.                the line length is less than the effective line length.
  88.                Default is to prefix the number of characters necessary to
  89.                obtain the effective line length.
  90.  
  91.      ----aaaa_n       Same as ----pppp_n except characters are appended to the end of a
  92.                line.
  93.  
  94.      ----ffff        Write the tab specification format line on the standard output
  95.                before any other lines are output.  The tab specification
  96.                format line which is printed will correspond to the format
  97.                specified in the _l_a_s_t ----oooo option.  If no ----oooo option is specified,
  98.                the line which is printed will contain the default
  99.                specification of ----8888.
  100.  
  101.      ----cccc_k       Change the prefix/append character to _k.  Default character for
  102.                _k is a space.
  103.  
  104.      ----llll_n       Set the effective line length to _n characters.  If _n is not
  105.                entered, ----llll defaults to 72.  The default line length without
  106.                the ----llll option is 80 characters.  Note that tabs and backspaces
  107.                are considered to be one character (use ----iiii to expand tabs to
  108.                spaces).
  109.  
  110.      The ----llll1111 must be used to set the effective line length shorter than any
  111.      existing line in the file so that the ----bbbb option is activated.
  112.  
  113. DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
  114.      All diagnostics are fatal.
  115.      _u_s_a_g_e: ...                   _n_e_w_f_o_r_m was called with a bad option.
  116.      _n_o_t -_s _f_o_r_m_a_t                There was no tab on one line.
  117.      _c_a_n'_t _o_p_e_n _f_i_l_e              Self-explanatory.
  118.      _i_n_t_e_r_n_a_l _l_i_n_e _t_o_o _l_o_n_g       A line exceeds 512 characters after being
  119.                                   expanded in the internal work buffer.
  120.      _t_a_b_s_p_e_c _i_n _e_r_r_o_r             A tab specification is incorrectly
  121.                                   formatted, or specified tab stops are not
  122.                                   ascending.
  123.      _t_a_b_s_p_e_c _i_n_d_i_r_e_c_t_i_o_n _i_l_l_e_g_a_l  A _t_a_b_s_p_e_c read from a file (or standard
  124.                                   input) may not contain a _t_a_b_s_p_e_c referencing
  125.                                   another file (or standard input).
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. NNNNEEEEWWWWFFFFOOOORRRRMMMM((((1111))))                                                          NNNNEEEEWWWWFFFFOOOORRRRMMMM((((1111))))
  137.  
  138.  
  139.  
  140.      0 - normal execution
  141.      1 - for any error
  142.  
  143. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  144.      csplit(1), tabs(1), fspec(4)
  145.  
  146. BBBBUUUUGGGGSSSS
  147.      _n_e_w_f_o_r_m normally only keeps track of physical characters; however, for
  148.      the ----iiii and ----oooo options, _n_e_w_f_o_r_m will keep track of backspaces in order to
  149.      line up tabs in the appropriate logical columns.
  150.  
  151.      _n_e_w_f_o_r_m will not prompt the user if a _t_a_b_s_p_e_c is to be read from the
  152.      standard input (by use of ----iiii-------- or ----oooo--------).
  153.  
  154.      If the ----ffff option is used, and the last ----oooo option specified was ----oooo--------, and
  155.      was preceded by either a ----oooo-------- or a ----iiii--------, the tab specification format
  156.      line will be incorrect.
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.